<template>
  <div>
    <div class="head">
      <div class="input">
        <span>公司名称：</span>
        <el-input v-model="queryData.name" placeholder="请输入课程名称" />
      </div>
      <el-button type="primary" class="btn" @click="search">查询</el-button>
      <el-button type="primary" class="btn" @click="reset">重置</el-button>
    </div>
    <div class="box">
      <el-table
        :data="tableData"
        border
        v-loading="isTableLoading"
        empty-text="暂无数据"
        no-filtered-userFrom-text="暂无筛选结果"
        style="width: 100%"
      >
        <el-table-column fixed type="index" align="center" label="序号" width="50" />
        <el-table-column fixed prop="name" align="center" show-overflow-tooltip label="公司名称" min-width="200" />
        <el-table-column prop="linkName" align="center" label="联系人" min-width="140" />
        <el-table-column prop="phone" align="center" label="联系电话" min-width="140"></el-table-column>
        <el-table-column prop="img" align="center" label="营业码" width="140"></el-table-column>
        <el-table-column fixed="right" align="center" prop="action" label="操作" width="120">
          <template #default="scope">
            <div class="action">
              <span>登录</span>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </div>

    <el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false">
      <span>确定删除吗？</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="delOk">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { dateFormat } from '../../libs/util';
export default {
  name: 'cultivate',
  data() {
    return {
      queryData: {
        name: '',
        size: 10,
      },
      total: 0,
      isTableLoading: false,
      tableData: [],
      dialogVisible: false,
    };
  },
  computed: {},
  created() {},
  mounted() {
    this.getList();
  },
  methods: {
    search() {
      this.queryData.page = 1;
      this.getList();
    },
    reset() {
      this.queryData.name = '';
      this.search();
    },
    getList() {
      console.log(this.queryData);

      this.isTableLoading = true;
      this.tableData = [
        {
          id: 1,
          name: 'xxxxxxxxxxxxx',
          linkName: '张三',
          phone: '111111111111',
          img: '',
        },
      ];
      this.total = 1;
      this.isTableLoading = false;
    },
  },
};
</script>

<style scoped>
.head {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  background: #ffffff;
  border-radius: 5px;
  padding: 20px;
  padding-bottom: 0px;
}
.input {
  display: flex;
  align-items: center;
  margin-right: 15px;
  margin-bottom: 20px;
}
.input > span {
  font-size: 12px;
  flex-shrink: 0;
}
.btn {
  margin-bottom: 20px;
}
.box {
  width: 100%;
  background: #ffffff;
  border-radius: 5px;
  padding: 20px;
  margin-top: 20px;
}
.action {
  display: flex;
  align-items: center;
  justify-content: center;
}
.action span {
  color: #0256ff;
  font-size: 12px;
  cursor: pointer;
  margin: 0 8px;
}
.demo-ruleForm /deep/ .el-form-item__label {
  line-height: 14px;
}
</style>
